package com.eshop.modules.activity.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

@TableName("store_coupon")
public class StoreCoupon extends BaseDomain
{
    @TableId
    @ApiModelProperty("优惠券ID")
    private Integer id;
    @NotBlank(message = "请填写优惠券名称")
    @ApiModelProperty("优惠券名称")
    private String title;
    @ApiModelProperty("兑换消耗积分值")
    private Integer integral;
    @DecimalMin(value = "0.00", message = "优惠券面值不在合法范围内")
    @DecimalMax(value = "99999999.99", message = "优惠券面值不在合法范围内")
    @ApiModelProperty("兑换的优惠券面值")
    private BigDecimal couponPrice;
    @DecimalMin(value = "0.00", message = "最低消费不在合法范围内")
    @DecimalMax(value = "99999999.99", message = "最低消费不在合法范围内")
    @ApiModelProperty("最低消费多少金额可用优惠券")
    private BigDecimal useMinPrice;
    @NotNull(message = "请输入有效期限")
    @ApiModelProperty("优惠券有效期限（单位：天）")
    private Integer couponTime;
    @ApiModelProperty("排序")
    private Integer sort;
    @ApiModelProperty("优惠券状态（0：关闭，1：开启） ")
    private Integer status;
    @ApiModelProperty("优惠券类型（0：通用券，1：商品券，2：内部券） ")
    private Integer type;
    @ApiModelProperty("优惠券绑定产品ID ")
    private String productId;
    
    public void copy(final StoreCoupon source) {
        BeanUtil.copyProperties((Object)source, (Object)this, CopyOptions.create().setIgnoreNullValue(true));
    }
    
    public Integer getId() {
        return this.id;
    }
    
    public String getTitle() {
        return this.title;
    }
    
    public Integer getIntegral() {
        return this.integral;
    }
    
    public BigDecimal getCouponPrice() {
        return this.couponPrice;
    }
    
    public BigDecimal getUseMinPrice() {
        return this.useMinPrice;
    }
    
    public Integer getCouponTime() {
        return this.couponTime;
    }
    
    public Integer getSort() {
        return this.sort;
    }
    
    public Integer getStatus() {
        return this.status;
    }
    
    public Integer getType() {
        return this.type;
    }
    
    public String getProductId() {
        return this.productId;
    }
    
    public void setId(final Integer id) {
        this.id = id;
    }
    
    public void setTitle(final String title) {
        this.title = title;
    }
    
    public void setIntegral(final Integer integral) {
        this.integral = integral;
    }
    
    public void setCouponPrice(final BigDecimal couponPrice) {
        this.couponPrice = couponPrice;
    }
    
    public void setUseMinPrice(final BigDecimal useMinPrice) {
        this.useMinPrice = useMinPrice;
    }
    
    public void setCouponTime(final Integer couponTime) {
        this.couponTime = couponTime;
    }
    
    public void setSort(final Integer sort) {
        this.sort = sort;
    }
    
    public void setStatus(final Integer status) {
        this.status = status;
    }
    
    public void setType(final Integer type) {
        this.type = type;
    }
    
    public void setProductId(final String productId) {
        this.productId = productId;
    }
    
    public String toString() {
        return "StoreCoupon(id=" + this.getId() + ", title=" + this.getTitle() + ", integral=" + this.getIntegral() + ", couponPrice=" + this.getCouponPrice() + ", useMinPrice=" + this.getUseMinPrice() + ", couponTime=" + this.getCouponTime() + ", sort=" + this.getSort() + ", status=" + this.getStatus() + ", type=" + this.getType() + ", productId=" + this.getProductId() + ")";
    }
    
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof StoreCoupon)) {
            return false;
        }
        final StoreCoupon other = (StoreCoupon)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        Label_0075: {
            if (this$id == null) {
                if (other$id == null) {
                    break Label_0075;
                }
            }
            else if (this$id.equals(other$id)) {
                break Label_0075;
            }
            return false;
        }
        final Object this$integral = this.getIntegral();
        final Object other$integral = other.getIntegral();
        Label_0112: {
            if (this$integral == null) {
                if (other$integral == null) {
                    break Label_0112;
                }
            }
            else if (this$integral.equals(other$integral)) {
                break Label_0112;
            }
            return false;
        }
        final Object this$couponTime = this.getCouponTime();
        final Object other$couponTime = other.getCouponTime();
        Label_0149: {
            if (this$couponTime == null) {
                if (other$couponTime == null) {
                    break Label_0149;
                }
            }
            else if (this$couponTime.equals(other$couponTime)) {
                break Label_0149;
            }
            return false;
        }
        final Object this$sort = this.getSort();
        final Object other$sort = other.getSort();
        Label_0186: {
            if (this$sort == null) {
                if (other$sort == null) {
                    break Label_0186;
                }
            }
            else if (this$sort.equals(other$sort)) {
                break Label_0186;
            }
            return false;
        }
        final Object this$status = this.getStatus();
        final Object other$status = other.getStatus();
        Label_0223: {
            if (this$status == null) {
                if (other$status == null) {
                    break Label_0223;
                }
            }
            else if (this$status.equals(other$status)) {
                break Label_0223;
            }
            return false;
        }
        final Object this$type = this.getType();
        final Object other$type = other.getType();
        Label_0260: {
            if (this$type == null) {
                if (other$type == null) {
                    break Label_0260;
                }
            }
            else if (this$type.equals(other$type)) {
                break Label_0260;
            }
            return false;
        }
        final Object this$title = this.getTitle();
        final Object other$title = other.getTitle();
        Label_0297: {
            if (this$title == null) {
                if (other$title == null) {
                    break Label_0297;
                }
            }
            else if (this$title.equals(other$title)) {
                break Label_0297;
            }
            return false;
        }
        final Object this$couponPrice = this.getCouponPrice();
        final Object other$couponPrice = other.getCouponPrice();
        Label_0334: {
            if (this$couponPrice == null) {
                if (other$couponPrice == null) {
                    break Label_0334;
                }
            }
            else if (this$couponPrice.equals(other$couponPrice)) {
                break Label_0334;
            }
            return false;
        }
        final Object this$useMinPrice = this.getUseMinPrice();
        final Object other$useMinPrice = other.getUseMinPrice();
        Label_0371: {
            if (this$useMinPrice == null) {
                if (other$useMinPrice == null) {
                    break Label_0371;
                }
            }
            else if (this$useMinPrice.equals(other$useMinPrice)) {
                break Label_0371;
            }
            return false;
        }
        final Object this$productId = this.getProductId();
        final Object other$productId = other.getProductId();
        if (this$productId == null) {
            if (other$productId == null) {
                return true;
            }
        }
        else if (this$productId.equals(other$productId)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof StoreCoupon;
    }
    
    public int hashCode() {
        final int PRIME = 59;
        int result = super.hashCode();
        final Object $id = this.getId();
        result = result * 59 + (($id == null) ? 43 : $id.hashCode());
        final Object $integral = this.getIntegral();
        result = result * 59 + (($integral == null) ? 43 : $integral.hashCode());
        final Object $couponTime = this.getCouponTime();
        result = result * 59 + (($couponTime == null) ? 43 : $couponTime.hashCode());
        final Object $sort = this.getSort();
        result = result * 59 + (($sort == null) ? 43 : $sort.hashCode());
        final Object $status = this.getStatus();
        result = result * 59 + (($status == null) ? 43 : $status.hashCode());
        final Object $type = this.getType();
        result = result * 59 + (($type == null) ? 43 : $type.hashCode());
        final Object $title = this.getTitle();
        result = result * 59 + (($title == null) ? 43 : $title.hashCode());
        final Object $couponPrice = this.getCouponPrice();
        result = result * 59 + (($couponPrice == null) ? 43 : $couponPrice.hashCode());
        final Object $useMinPrice = this.getUseMinPrice();
        result = result * 59 + (($useMinPrice == null) ? 43 : $useMinPrice.hashCode());
        final Object $productId = this.getProductId();
        result = result * 59 + (($productId == null) ? 43 : $productId.hashCode());
        return result;
    }
}
